package com.commentlib.utils;

import android.content.Intent;
import android.os.Bundle;

import com.commentlib.app.BaseApplication;

/**
 * 跳转工具类
 */
public class IntentUtils {

    public static void GoActivity(Class clz){
        Intent intent = new Intent(BaseApplication.activity, clz);
        BaseApplication.activity.startActivity(intent);
    }

    public static void GoActivityFinish(Class clz){
        Intent intent = new Intent(BaseApplication.activity, clz);
        BaseApplication.activity.startActivity(intent);
        BaseApplication.activity.finish();
    }

    public static void GoActivityBundle(Class clz, Bundle bundle){
        Intent intent = new Intent(BaseApplication.activity, clz);
        intent.putExtras(bundle);
        BaseApplication.activity.startActivity(intent);
    }

    public static void GoActivityOnResult(Class clz, int reqCode){
        Intent intent = new Intent(BaseApplication.activity, clz);
        BaseApplication.activity.startActivityForResult(intent, reqCode);
    }

    public static void GoActivityOnResult(Class clz, Bundle bundle, int reqCode){
        Intent intent = new Intent(BaseApplication.activity, clz);
        intent.putExtras(bundle);
        BaseApplication.activity.startActivityForResult(intent, reqCode);
    }
}
